﻿using System;
using System.Collections.Generic;
using System.Text;

namespace adb
{
    /// <summary>
    /// Mqtt主题
    /// </summary>
    public class TopicBase
    {
        /// <summary>
        /// 警报数据上传
        /// </summary>
        public static string alarmTopic  => "/bz/alarm/data";

        /// <summary>
        /// 开关数据下传
        /// </summary>
        public static string switchDownloadTopic => "/bz/switch/down";
        /// <summary>
        /// 开关数据下传
        /// </summary>
        public static string switchDateTopic => "/bz/switch/data";
        /// <summary>
        /// 情雨数据上传
        /// </summary>
        public static string rainDataTopic => "/bz/rain/data";
        /// <summary>
        /// 发电机数组
        /// </summary>
        public static string alternatorDataTopic => "/bz/alternator/data";
        /// <summary>
        /// 监控数据
        /// </summary>
        public static string videoDataTopic => "/bz/video/data";
        /// <summary>
        /// 上网数据
        /// </summary>
        public static string salesDataTopic => "/bz/salepower/data";
        /// <summary>
        /// 停止传感器
        /// </summary>
        public static string stopDeviceTopic => "/bz/stop/device";
        /// <summary>
        /// 按类型返回使用的路径
        /// </summary>
        /// <param name="typeId"></param>
        /// <returns></returns>
        public static string GetTopic(int typeId) {
            switch (typeId) {
                case 820076:
                    return salesDataTopic;
                case 820002:
                    return switchDateTopic;
                case 820003:
                    return rainDataTopic;
                case 820004:
                    return videoDataTopic;
                case 820005:
                    return alternatorDataTopic;
                case 820077:
                    return salesDataTopic;
            }
            return "";
        }
    }
}
